{extend name="common@base" /}
{block name="content"}
<section class="content">
  <div class="row">
    <div class="col-xs-6">
      <form role="form" class="form" method="post">
        <input type="hidden" name="form[id]" value="{$id}">
        <input type="hidden" name="form[parent_id]" value="{$parent_id}">
        <div class="box-body">
          <div class="form-group">
            <label>上级菜单</label>
            {:form_dropdown('form[parent_id]',$menus,$row ? $row.parent_id : 0,'class="form-control"')}
          </div>
          <div class="form-group">
            <label>菜单名称</label>
            <input name="form[title]" type="text" class="form-control" value="{$row?$row.title:$title}">
          </div>
          <div class="form-group">
            <label>模块[MODULE]</label>
            <input name="form[module]" type="text" class="form-control" value="{$row.module}">
          </div>
          <div class="form-group">
            <label>功能[CONTROLLER]</label>
            <input name="form[controller]" type="text" class="form-control" value="{$row.controller}">

          </div>
          <div class="form-group">
            <label>动作[ACTION]</label>
            <input name="form[action]" type="text" class="form-control" value="{$row.action}">
          </div>
          <div class="form-group">
            <label>跳转URL[URL]</label>
            <input name="form[url]" type="text" class="form-control" value="{$row.url}">
          </div>
          <div class="form-group">
            <label>图标ICON</label>
            <input name="form[icon]" type="text" class="form-control" value="{$row.icon}">
          </div>
          <div class="form-group">
            <label>样式Class</label>
            <input name="form[class]" type="text" class="form-control" value="{$row.class}">
          </div>
          <div class="form-group">
            <label>排序</label>
            <input name="form[position]" type="number" class="form-control" value="{$row.position}">
          </div>
          <div class="form-group">
            <label>隐藏菜单</label>
            <div class="checkbox">
              <label>
                {:form_checkbox('form[is_hide]',1,$row.is_hide)}是否隐藏
              </label>
            </div>
          </div>
        </div>
        <div class="box-footer">
          <button type="submit" class="btn btn-primary js-ajax-submit">保存</button>
          <a href="javascript:history.back(-1)" class="btn btn-default  ">返回</a>
        </div>
      </form>
    </div>
  </div>
</section>
{/block}
{block name="page_script"}
<script>
  require(["layer_config", "ajaxForm"], function (layer) {

  });
</script>
{/block}
